package com.xhwl.centiotdata.suppliersystem.guangtuo.alarmhost.websocket.handle;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zyz
 * @date 2023-04-26
 * 报警主机通知处理工厂
 */
public class AlarmHostNotifyHandleFactory {

    private static Map<Object, AlarmHostNotifyHandle> handlerMap = new HashMap<>();

    public static AlarmHostNotifyHandle getInvokeStrategy(Object topic) {
        return handlerMap.get(topic);
    }

    public static void register(Object topic, AlarmHostNotifyHandle handler) {
        if (StringUtils.isEmpty(topic)) {
            return;
        }
        handlerMap.put(topic, handler);
    }

}
